package edu.hnnu.sport_event.entity;

import java.util.Date;
import java.util.List;

public class Event {

    private Integer id;         // ID
    private String name;        // 比赛名称
    private Byte quota;         // 总名额
    private Byte participants;  // 报名人数
    private Date time;          // 比赛开始时间
    private String location;    // 比赛地点

    private Integer score;      // 比赛分数

    private List<Student> participantsList;

    public Event() {
    }

    public Integer getId() {
        return this.id;
    }

    public String getName() {
        return this.name;
    }

    public Byte getQuota() {
        return this.quota;
    }

    public Byte getParticipants() {
        return this.participants;
    }

    public Date getTime() {
        return this.time;
    }

    public String getLocation() {
        return this.location;
    }

    public Integer getScore() {
        return this.score;
    }

    public List<Student> getParticipantsList() {
        return this.participantsList;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setQuota(Byte quota) {
        this.quota = quota;
    }

    public void setParticipants(Byte participants) {
        this.participants = participants;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    public void setParticipantsList(List<Student> participantsList) {
        this.participantsList = participantsList;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof Event)) return false;
        final Event other = (Event) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$id = this.getId();
        final Object other$id = other.getId();
        if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
        final Object this$name = this.getName();
        final Object other$name = other.getName();
        if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false;
        final Object this$quota = this.getQuota();
        final Object other$quota = other.getQuota();
        if (this$quota == null ? other$quota != null : !this$quota.equals(other$quota)) return false;
        final Object this$participants = this.getParticipants();
        final Object other$participants = other.getParticipants();
        if (this$participants == null ? other$participants != null : !this$participants.equals(other$participants))
            return false;
        final Object this$time = this.getTime();
        final Object other$time = other.getTime();
        if (this$time == null ? other$time != null : !this$time.equals(other$time)) return false;
        final Object this$location = this.getLocation();
        final Object other$location = other.getLocation();
        if (this$location == null ? other$location != null : !this$location.equals(other$location)) return false;
        final Object this$score = this.getScore();
        final Object other$score = other.getScore();
        if (this$score == null ? other$score != null : !this$score.equals(other$score)) return false;
        final Object this$participantsList = this.getParticipantsList();
        final Object other$participantsList = other.getParticipantsList();
        if (this$participantsList == null ? other$participantsList != null : !this$participantsList.equals(other$participantsList))
            return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof Event;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $id = this.getId();
        result = result * PRIME + ($id == null ? 43 : $id.hashCode());
        final Object $name = this.getName();
        result = result * PRIME + ($name == null ? 43 : $name.hashCode());
        final Object $quota = this.getQuota();
        result = result * PRIME + ($quota == null ? 43 : $quota.hashCode());
        final Object $participants = this.getParticipants();
        result = result * PRIME + ($participants == null ? 43 : $participants.hashCode());
        final Object $time = this.getTime();
        result = result * PRIME + ($time == null ? 43 : $time.hashCode());
        final Object $location = this.getLocation();
        result = result * PRIME + ($location == null ? 43 : $location.hashCode());
        final Object $score = this.getScore();
        result = result * PRIME + ($score == null ? 43 : $score.hashCode());
        final Object $participantsList = this.getParticipantsList();
        result = result * PRIME + ($participantsList == null ? 43 : $participantsList.hashCode());
        return result;
    }

    public String toString() {
        return "Event(id=" + this.getId() + ", name=" + this.getName() + ", quota=" + this.getQuota() + ", participants=" + this.getParticipants() + ", time=" + this.getTime() + ", location=" + this.getLocation() + ", score=" + this.getScore() + ", participantsList=" + this.getParticipantsList() + ")";
    }
}